<script type="text/ng-template" id="template-blog-slides.html">
    <h3>首页内容管理</h3>

    <ul class="nav nav-tabs">
      <li role="presentation"><a href="#/publish">新闻文章</a></li>
      <li role="presentation" class="active"><a href="#/blog/slides">轮播图</a></li>
    </ul>

    <div class="panel panel-default" style="margin-top:20px;">
      <div class="panel-body">
        <div class="row" ng-show="carouselshow">
          <div class="col-xs-offset-3 col-xs-6" >
            <div id="carouselid" class="carousel slide text-center">
              <ol class="carousel-indicators" >
                <li data-target="#carouselid" data-slide-to="{{slide.index}}" class="{{slide.active}}" ng-repeat="slide in slides"</li>
              </ol>
            
              <div class="carousel-inner">
                <div class="item {{slide.active}}" ng-repeat="slide in slides" >
                  <img ng-src="{{slide.image}}" ng-click="picshow='true'" style="max-width:640px; max-height:300px;">
                </div>
              </div>
            </div>
          </div>
        </div>

        <div ng-hide="carouselshow" class="text-center">
          <img ng-src="{{imageSrc}}" style="max-width:640px; max-height:300px;">
        </div>


        <div class="input-group" style="margin-top:15px;">
          <input class="form-control" ng-model="imageSrc" placeholder='请点击“选择”按钮选择图片，点击“提交”按钮上传图片，点击“移除”按钮取消图片选择'>
          
          <span class="input-group-btn">
            <button class="btn btn-primary" type="button" ng-click="choosePic()">
              选择
            </button>
          </span> 
          
          <span class="input-group-btn">
            <button class="btn btn-primary" type="button" ng-click="submitPic()">
              提交
            </button>
          </span>
          <span class="input-group-btn">
            <button class="btn btn-primary" type="button" ng-click="inputClear()">
              取消
            </button>
          </span>    

          <span class="input-group-btn">
            <button class="btn btn-primary" type="button" ng-click="picshow='true'" ng-hide="picshow">
              移除
            </button>
          </span>

          <span class="input-group-btn">
            <button class="btn btn-primary" type="button" ng-click="picshow='false'" ng-show="picshow">
              完毕
            </button>
          </span>

          <span class="input-group-btn">
            <input type="file" id="inputfile" style="display:none" file-model="fileupload">
          </span>  
        </div>
      </div>  
    </div>

    <div class="panel panel-default" style="margin-top:20px;" ng-show="picshow"  ng-init="picshow='false'">
      <div class="panel-body">
        <div class="row">
          <div class="col-md-4 col-sm-6 text-center" ng-repeat="slide in slides">
            <img ng-src="{{slide.image}}"  class="img-circle" style="max-height:100px;max-width:200px;margin-top:10px;">
            <span class="btn btn-danger btn-xs" ng-click="deletePic(slide.index)" >
              <i class="fa fa-times"></i>
            </span>         
          </div>
        </div>        
      </div>
    </div>
</script>